From: Keir Fraser Date: Tue, 16 Jun 2009 10:47:09 +0000 (+0100) Subject: tmem: cleanups X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13764 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7cd9ff256ccc9f57f4c3200310669ee34b3e0d30;p=xen.git tmem: cleanups - don't mis-use guest handle for passing an MFN value - eliminate unnecessary (and misplaced) use of XEN_GUEST_HANDLE_64 - use copy_from_guest() instead of __copy_from_guest() for loading the argument structure Signed-off-by: Jan Beulich --- diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c index 774bb7dc12..f168535a2a 100644 --- a/xen/common/tmem_xen.c +++ b/xen/common/tmem_xen.c @@ -87,10 +87,7 @@ static inline void *cli_mfn_to_va(tmem_cli_mfn_t cmfn, unsigned long *pcli_mfn) unsigned long cli_mfn; p2m_type_t t; - - if (is_pv_32on64_vcpu(current)) - cmfn.p = (void *)((unsigned long)cmfn.p & 0xffffffffUL); - cli_mfn = mfn_x(gfn_to_mfn(current->domain,(unsigned long)cmfn.p,&t)); + cli_mfn = mfn_x(gfn_to_mfn(current->domain, cmfn, &t)); if (t != p2m_ram_rw) return NULL; if (pcli_mfn != NULL) diff --git a/xen/include/public/tmem.h b/xen/include/public/tmem.h index b8d608f591..cef6230b89 100644 --- a/xen/include/public/tmem.h +++ b/xen/include/public/tmem.h @@ -66,7 +66,7 @@ #ifndef __ASSEMBLY__ -typedef XEN_GUEST_HANDLE(void) tmem_cli_mfn_t; +typedef xen_pfn_t tmem_cli_mfn_t; typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t; struct tmem_op { uint32_t cmd; @@ -95,7 +95,6 @@ struct tmem_op { }; typedef struct tmem_op tmem_op_t; DEFINE_XEN_GUEST_HANDLE(tmem_op_t); -typedef XEN_GUEST_HANDLE_64(tmem_op_t) tmem_cli_op_t; #endif diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h index 8d653c27df..7da18e67e6 100644 --- a/xen/include/xen/tmem_xen.h +++ b/xen/include/xen/tmem_xen.h @@ -281,12 +281,12 @@ static inline bool_t tmh_current_is_privileged(void) /* these typedefs are in the public/tmem.h interface typedef XEN_GUEST_HANDLE(void) cli_mfn_t; typedef XEN_GUEST_HANDLE(char) cli_va_t; -typedef XEN_GUEST_HANDLE(tmem_op_t) cli_tmemop_t; */ +typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t; static inline int tmh_get_tmemop_from_client(tmem_op_t *op, tmem_cli_op_t uops) { - return __copy_from_guest(op, uops, 1); + return copy_from_guest(op, uops, 1); } static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,